/**
 * Copyright (c) 2016 Lenovo Group
 * All Rights Reserved.
 * 
 * Project Name:lmrp-api
 * Create Time: 2016年1月26日 上午11:30:54
 */
package com.lenovo.lmrp.api.assigntrace;

import java.util.List;

import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;

import com.lenovo.lmrp.api.model.RestResponse;
import com.lenovo.lmrp.api.model.view.ItsmEntityFieldMapingVO;
import com.lenovo.lmrp.api.model.view.ItsmEntityMapingVO;
import com.lenovo.lmrp.api.model.view.ItsmEnumMapingVO;

/**
 * @author songyz
 *
 */
public interface IItsmMetadata {

	/**
	 * Query entity mapping list
	 * 查询一个工单系统下的实体对象与平台对象的映射列表，返回的是实体映射对象数组，实体映射对象定义如输出结果列表。
	 * 
	 * @param itsmcode
	 * @return
	 */
	@GET
	@Path("/config/metadata/{itsmcode}/entities")
	public RestResponse<List<ItsmEntityMapingVO>> getItsmEntityMapList(@PathParam("itsmcode") String itsmcode);

	/**
	 * Query entity field mapping list
	 * 查询一个工单系统中的实体对象(或数据表)字段与平台对象字段的映射。返回的是对象数组，对象定义如输出结果列表所示。
	 */
	@GET
	@Path("/config/metadata/{itsmcode}/entities/{entityid}/fields")
	public RestResponse<List<ItsmEntityFieldMapingVO>> getItsmEntityFieldList(@PathParam("itsmcode") String itsmcode,
																			  @PathParam("entityid") String entityid);

	/**
	 * query enumeration value mapping list 查询枚举值的映射列表
	 * 
	 * @param itsmcode
	 * @return
	 */
	@GET
	@Path("/config/metadata/{itsmcode}/enums/")
	public RestResponse<List<ItsmEnumMapingVO>> getEnumsMapingList(@PathParam("itsmcode") String itsmcode);

	/**
	 * Delete entities mapping 删除工单系统下的实体配置，关联的实体字段配置也将删除。
	 * 
	 * @param itsmcode
	 * @param entityid
	 */
	@DELETE
	@Path("/config/metadata/{itsmcode}/entities/{entityid}")
	public void deleteEntityMaping(@PathParam("itsmcode") String itsmcode, 
								   @PathParam("entityid") String entityid);

	/**
	 * Delete entities field mapping 
	 * 删除实体字段映射
	 * 
	 * @param itsmcode
	 * @param entityid
	 * @param fieldid
	 */
	@DELETE
	@Path("/config/metadata/{itsmcode}/entities/{entityid}/{fieldid}")
	public void deleteEntityFieldMaping(@PathParam("itsmcode") String itsmcode,
										@PathParam("entityid") String entityid,
										@PathParam("fieldid") String fieldid);
	
	/**
	 * Delete the enumeration value mapping
	 * 删除枚举值映射
	 * 
	 * @param itsmcode
	 * @param enumid
	 */
	@DELETE
	@Path("/config/metadata/{itsmcode}/enums/{enumid}")
	public void deleteEnumMapping(@PathParam("itsmcode") String itsmcode,
								  @PathParam("enumid") String enumid);
	
	/**
	 * Add/modify entities mapping
	 * 添加/修改实体映射
	 * 
	 * @param itsmcode
	 * @param itsmEntityMapingVO
	 */
	@POST
	@Path("/config/metadata/{itsmcode}/entities")
	public void saveOrUpdateEntityMaping(@PathParam("itsmcode") String itsmcode,
			   							 ItsmEntityMapingVO itsmEntityMapingVO);
	
	/**
	 * Add/modify entity field mapping
	 * 添加/修改实体字段映射
	 * 
	 * @param itsmcode
	 * @param entityid
	 * @param itsmEntityFieldMapingVO
	 */
	@POST
	@Path("/config/metadata/{itsmcode}/entities/{entityid}/fields")
	public void saveOrUpdateEntityFieldMaping(@PathParam("itsmcode") String itsmcode,
											  @PathParam("entityid") String entityid,
									 		  ItsmEntityFieldMapingVO itsmEntityFieldMapingVO);
	/**
	 * Add/modify the enumeration mapping
	 * 添加/修改枚举映射
	 */
	@POST
	@Path("/config/metadata/{itsmcode}/entities/{entityid}/fields")
	public void saveOrUpdateEnumMaping(@PathParam("itsmcode") String itsmcode,
									   @PathParam("entityid") String entityid,
									   ItsmEnumMapingVO itsmEnumMapingVO);
}
